Skip to content

Alter a couple E2E exploration test so that they don't fail on evening UTC#6400

Merged
zoldar merged 1 commit into
masterfrom
e2e-exploration-failing-tests-time
May 26, 2026
Merged

Alter a couple E2E exploration test so that they don't fail on evening UTC#6400
zoldar merged 1 commit into
masterfrom
e2e-exploration-failing-tests-time

Conversation

@zoldar
Copy link
Copy Markdown
Contributor

@zoldar zoldar commented May 25, 2026

Changes

While this change makes the tests not fail at least now, it's not ideal. It's also not really a fix but rather a cover up of a certain behavior of FE logic building the initial DashboardState object.

The default period of the query is determined when building dashboard state context in https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-state-context.tsx#L71-L77.

If the current time falls into today or yesterday, a day period is chosen: https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-time-periods.ts#L637-L639

Even if the native stats start date falls on yesterday, the default day is always picked as today in https://github.com/plausible/analytics/blob/e2e-exploration-failing-tests-time/assets/js/dashboard/dashboard-state-context.tsx#L98

It means that for stats which a) started collecting yesterday b) don't have any events for today (yet), the dashboard will turn up initially empty. I suppose it's a reasonable compromise but also something that can trip us up when building synthethic test cases via methods like populate_stats.

For now this should do well enough, however, the tests relying on stats setups shifted minutes in the past might fail shortly after midnight UTC. For better robustness, we'd probably have to ensure that the most suitable period is always set manually as part of the test setup. We might circle back to that further robustness refinement later on.

@zoldar zoldar requested a review from aerosol May 25, 2026 20:40
@zoldar zoldar added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 26, 2026
@zoldar zoldar enabled auto-merge May 26, 2026 07:22
@zoldar zoldar force-pushed the e2e-exploration-failing-tests-time branch from 114b476 to 9eddb5e Compare May 26, 2026 07:23
@zoldar zoldar added this pull request to the merge queue May 26, 2026
Merged via the queue into master with commit 6e26fd7 May 26, 2026
41 checks passed
@zoldar zoldar deleted the e2e-exploration-failing-tests-time branch May 26, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants